package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.BHoldConfigMapper;
import com.ruoyi.system.domain.api.BHoldConfig;
import com.ruoyi.system.service.IBHoldConfigService;

/**
 * 守护配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-21
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class BHoldConfigServiceImpl implements IBHoldConfigService 
{
    @Autowired
    private BHoldConfigMapper bHoldConfigMapper;

    /**
     * 查询守护配置
     * 
     * @param id 守护配置主键
     * @return 守护配置
     */
    @Override
    public BHoldConfig selectBHoldConfigById(Long id)
    {
        return bHoldConfigMapper.selectBHoldConfigById(id);
    }

    /**
     * 查询守护配置列表
     * 
     * @param bHoldConfig 守护配置
     * @return 守护配置
     */
    @Override
    public List<BHoldConfig> selectBHoldConfigList(BHoldConfig bHoldConfig)
    {
        return bHoldConfigMapper.selectBHoldConfigList(bHoldConfig);
    }

    /**
     * 新增守护配置
     * 
     * @param bHoldConfig 守护配置
     * @return 结果
     */
    @Override
    public int insertBHoldConfig(BHoldConfig bHoldConfig)
    {
        bHoldConfig.setCreateTime(DateUtils.getNowDate());
        return bHoldConfigMapper.insertBHoldConfig(bHoldConfig);
    }

    /**
     * 修改守护配置
     * 
     * @param bHoldConfig 守护配置
     * @return 结果
     */
    @Override
    public int updateBHoldConfig(BHoldConfig bHoldConfig)
    {
        return bHoldConfigMapper.updateBHoldConfig(bHoldConfig);
    }

    /**
     * 批量删除守护配置
     * 
     * @param ids 需要删除的守护配置主键
     * @return 结果
     */
    @Override
    public int deleteBHoldConfigByIds(Long[] ids)
    {
        return bHoldConfigMapper.deleteBHoldConfigByIds(ids);
    }

    /**
     * 删除守护配置信息
     * 
     * @param id 守护配置主键
     * @return 结果
     */
    @Override
    public int deleteBHoldConfigById(Long id)
    {
        return bHoldConfigMapper.deleteBHoldConfigById(id);
    }
}
